package com.jamu.mbok;

import android.app.Activity;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;

public class LevelSelect extends Activity{
	Button lvl1;
	Button lvl2;
	Button lvl3;
	Button lvl4;
	Button lvl5;
	
	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
		getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
        setContentView(R.layout.level_layout);
        castItem();
        addAction();
	}
	
	public void castItem(){
		lvl1 = (Button)findViewById(R.id.lvl_1);
		lvl2 = (Button)findViewById(R.id.lvl_2);
		lvl3 = (Button)findViewById(R.id.lvl_3);
		lvl4 = (Button)findViewById(R.id.lvl_4);
		lvl5 = (Button)findViewById(R.id.lvl_5);
	}
	
	public void addAction() {
		lvl1.setOnTouchListener(new OnTouchListener() {
			
			@Override
			public boolean onTouch(View v, MotionEvent event) {
				if(event.getAction()==MotionEvent.ACTION_DOWN){
					lvl1.setBackgroundResource(R.drawable.level_1_clicked);
				}else if(event.getAction()==MotionEvent.ACTION_UP){
					lvl1.setBackgroundResource(R.drawable.level_1);
				} 
				
				return false;
			}
		});
		
		lvl2.setOnTouchListener(new OnTouchListener() {
			
			@Override
			public boolean onTouch(View v, MotionEvent event) {
								
				return false;
			}
		});
		
		lvl3.setOnTouchListener(new OnTouchListener() {
			
			@Override
			public boolean onTouch(View v, MotionEvent event) {
				
				return false;
			}
		});
		
		lvl4.setOnTouchListener(new OnTouchListener() {
			
			@Override
			public boolean onTouch(View v, MotionEvent event) {
				
				return false;
			}
		});
		
		lvl5.setOnTouchListener(new OnTouchListener() {
			
			@Override
			public boolean onTouch(View v, MotionEvent event) {
				
				return false;
			}
		});
		
	}
	
}
